const app = getApp();
const WxParse = require('../../wxParse/wxParse.js');
Page({

    data: {
        id: 0,
        info: {}
    },
    onLoad: function (options) {
        this.data.id = options.id;
        this.getInfo();
    },
    getInfo() {
        app.http.$ajax({
            url: 'v1.evaluation/detail',
            data: {
                id: this.data.id
            }
        }, {
            success: (res) => {
                WxParse.wxParse('introduce', 'html', res.data.content, this, 5);
                this.setData({
                    info: app.processImg(res.data)
                });
            }
        })
    },
    buy(){
        if(this.data.info.id == undefined) {
          return;
        }
        let obj = Object.assign(this.data.info, {content:''})
        let str = JSON.stringify(obj);
        wx.navigateTo({
            url: '/pages/buy1/buy1?info=' + str,
        })
    }
})